
<form class="well form-horizontal span8" action="<?php echo base_url() . "admin.php/distributivo/actualizar" ?>" method="post">
    <legend>MODIFICAR EL DISTRIBUTIVO DE DOCENTES</legend>

    <div class="control-group">
        <label class="control-label" for="select01">PERIODO ACTUAL</label>
        <div class="controls ">
            <select name="ide_lec" class="span3">
                <?php
                foreach ($periodos as $i => $per) {
                    echo ("<option value='" . $per["ide_lec"] . "'>");
                    echo ($per["descripcion_lec"] . "</option>");
                }
                ?>
            </select>

        </div>
    </div>


    <div class="control-group">
        <label class="control-label" for="select03">CARRERAS</label>
        <div class="controls ">
            <select name="ide_car" class="span3" autofocus>
                <?php
                foreach ($carrera as $j => $car) {
                    echo ("<option value='" . $car["ide_car"] . "'>");
                    echo ($car["nombre_car"] . "</option>");
                }
                ?>
            </select>

        </div>
    </div>

    <div class="control-group">
        <label class="control-label" for="select03">Lista de Pensums</label>
        <div class="controls ">
            <select id="select02" name="ide_pen" class="span3">

                <?php
                foreach ($pensum as $k => $pen) {

                    echo ("<option value='" . $pen["ide_pen"] . "'>");
                    echo ($pen["descripcion_pen"] . "-" . $pen["estado_pen"] . "</option>");
                }
                ?>

            </select>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="select04">Lista de Ciclos</label>
        <div class="controls ">
            <select id="codigo_cic"  name="codigo_cic" class="span3">
                <?php
                foreach ($ciclo as $l => $cic) {
                    echo ("<option value='" . $cic["ide_cic"] . "'>");
                    echo ($cic["codigo_cic"] . "-" . $cic["nombre_cic"] . "</option>");
                }
                ?>

            </select>
        </div>
    </div>

    <div class="control-group">
        <label class="control-label" for="select02">JORNADA DE TRABAJO</label>
        <div class="controls ">
            <select name="seccion" class="span3">

                <option value="<?php echo ($seccion); ?>">
                    <?php echo (($seccion == 1 ? "DIURNO" : ($seccion == 2 ? "NOCTURNO" : "FINES DE SEMANA"))); ?> 
                </option>

            </select>


        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="select03">PARALELO</label>
        <div class="controls ">
            <select name="paralelo" class="span1">
                <option value="<?php echo ($paralelo); ?>"><?php echo ($paralelo); ?></option>
            </select>


        </div>
    </div>

    <div id="tabladistributivo" >
        <table class="table table-bordered table-striped table-condensed">
            <thead>
                <tr>
                    <th>ASIGNA</th>
                    <th>COD</th>
                    <th>NOMBRE DE LA MATERIA</th>
                    <th>CRED</th>
                    <th>ESTADO</th>
                    <th>SELECCIONAR EL DOCENTE</th>
                </tr>
            </thead>
            <tbody>
                <?php
                $nro_filas = 0;
                if (!empty($materias)) {
                    $nro_filas = count($materias);
                    foreach ($materias as $i => $mat) {
                        ?>
                        <tr>
                            <td ><div centrar align="center">
                                    <input  type="hidden" <?php echo "name='ide_mat" . $i . "' value='" . $mat['ide_mat'] . "'"; ?> /></div></td>
                            <td><?php echo $mat['codigo_mat'] ?></td>
                            <td><?php echo $mat['nombre_mat'] ?></td>
                            <td><?php echo $mat['creditos_mat'] ?></td>
                            <td >
                                <select id="estado"  <?php echo "name='estado" . $i . "'"; ?> class="span1">
                                    <option value="0"  <?php echo (($mat['estado'] == '0' ? " selected" : " ")); ?>>ACTIVO</option>
                                    <option value="1"  <?php echo (($mat['estado'] == '1' ? " selected" : " ")); ?>>PENDIENTE</option>

                                </select>


                            </td>   
                            <td >
                                <select id="select02"  <?php echo "name='ide_doc" . $i . "'"; ?> class="span3">
                                    <?php
                                    foreach ($docentes as $k => $doc) {

                                        echo ("<option value='" . $doc["ide_doc"] . "'");
                                        echo (($ide_doc == $doc["ide_doc"] ? " selected" : "") . ">");
                                        echo ($doc["apellido_pers"] . " " . $doc["nombre_pers"] . "</option>");
                                    }
                                    ?>

                                </select>


                            </td>   
                        </tr>
                        <?php
                    }
                }
                ?>
            </tbody>
        </table>        
    </div>            

    <div class="controls">
        <input type="hidden" name="nro_filas" value="<?php echo $nro_filas; ?>">
        <input type="hidden"  name="txtopc" value="<?php echo $opc; ?>">

        <?php if ($opc == 'upd') { ?>
            <button type="submit" class="btn">Modificar Datos</button>

        <?php } else { ?>
            <button type="submit" class="btn">Eliminar Datos</button>
        <?php } ?>
        <a href="<?php echo base_url() . "admin.php/distributivo/inicio" ?>">
            <img src="<?php echo base_url(); ?>commons/images/boton_volver.gif"></a>

    </div> 

</form>


